To satisfy the growing demands of users, computing systems are required to operate efficiently at faster and faster speeds with little or no associated downtime. In efforts to accommodate these demands, programmers construct programs which may include multiple instruction “threads” having a number of instructions. These threads control the operation and flow of the program (or application) running on the system. In some computing architectures, one processor may execute multiple threads using a single processor. In other computing architectures, multiple threads may be executed by multiple processors, where each processor may support a different thread.
In conjunction with threaded programs, programmers use transaction coding, including nested transactions, to improve computing synchronization and efficiency. Transactions are a key technology for easing programming on multi-core architectures. A transaction may be described as a sequence of steps executed on a thread. Transactions are also referred to as being “atomic,” since a transaction typically commits or aborts. For example, one transaction model begins when a thread announces the start of a transaction, executes a sequence of operations, and then tries to commit the transaction. If the commit succeeds, the transaction operations take effect in memory, if not, the operations may be discarded. Nested transactions may occur in transactional programs when they call library code that uses transactions internally. Nested transactions also allow programmers to avoid expensive rollbacks when potential conflicts are limited within a small portion of a large transaction.
Conventional computing systems allow programs to allocate and deallocate memory dynamically. However, to preserve semantics, these conventional computing systems do not allocate and deallocate memory from within a transactional code block, including nested transactions. A conventional computing system, exclusive of transactions, may allocate a block of memory when a program invokes a memory allocation routine, such as a standard malloc routine for example. The malloc routine finds a free memory block, marks the block as being allocated, and returns a pointer to the program which corresponds to the allocated block. The program may use the pointer to store data to the memory block. The program may free the memory block, using a standard free routine for example, when the block is no longer required. The free routine marks the memory block as being free so that the block may be otherwise allocated. As stated above, currently, these standard or conventional memory allocation and deallocation techniques are not used in conjunction with transactional code blocks, since the semantics associated with the transactional code may not be preserved when using the standard malloc and free routines.